package com.company;

import java.util.Scanner;

/**
 * 输入一个字符串统计每个元音字母在字符串中出现的次数，对于结果输出五行
 */
public class demo27 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入字符串：");
        String s=sc.nextLine();
        int counta=0,counte=0,counti=0,counto=0,countu=0;
        for (int i=0;i<s.length();i++){
            if (s.charAt(i)=='a'){
                counta++;
            }else if (s.charAt(i)=='e'){
                counte++;
            }else if (s.charAt(i)=='i'){
                counti++;
            }else if (s.charAt(i)=='o'){
                counto++;
            }else if (s.charAt(i)=='u'){
                countu++;
            }

        }

        System.out.println("a出现次数："+counta);
        System.out.println("e出现次数："+counte);
        System.out.println("i出现次数："+counti);
        System.out.println("o出现次数："+counto);
        System.out.println("u出现次数："+countu);
    }
}
